const getCookies = require('../until/getCookies')

const {USER_UID} = require('../config/config.data')

// 登录状态校验

module.exports = (req,res,next) =>{
    
    let searchUser = getCookies(req.get('cookie'),'uid')

    let uid = USER_UID.find(item=>item.uid === searchUser)
   
    if(!uid){
        res.send({code:0,msg:"没有登录，请登录后访问"})
        return
    }

    next()
}